package com.villaday.idf.adapter3;

import android.content.Context;
import android.view.View;

import com.villaday.idf.R;
import com.villaday.idf.base.AbsRecyclerViewAdapter;
import com.villaday.idf.model3.CreatOrdersEntity;

public class OrderInputResultAdapter extends AbsRecyclerViewAdapter<CreatOrdersEntity.BodyBean.GuestsBean> {

    public OrderInputResultAdapter(Context context) {
        super(context, R.layout.recycle_order_input_result);
    }

    @Override
    public void onBindHolder(AbsRecyclerViewAdapter.RecyclerViewHolder holder, CreatOrdersEntity.BodyBean.GuestsBean d, int position) {

        holder.bindTextView(R.id.tv_oir_name, d.getName());

        if (data.size() > 1) {
            holder.bindTextView(R.id.tv_title, "入住人" + (position + 1));
        } else {
            holder.bindTextView(R.id.tv_title, "入住人");
        }

        if (d.getIdcard() != null && !d.getIdcard().equals("")) {
            holder.getView(R.id.tv_oir_card).setVisibility(View.VISIBLE);
            holder.bindTextView(R.id.tv_oir_card, d.getIdcard());
            holder.getView(R.id.vw_oir).setVisibility(View.VISIBLE);
        } else {
            holder.getView(R.id.tv_oir_card).setVisibility(View.GONE);
            holder.getView(R.id.vw_oir).setVisibility(View.GONE);
        }
    }
}
